<?php /* Smarty version 2.3.0, created on 2011-08-18 00:20:55
         compiled from Default/edit_survey_edit_answer.tpl */ ?>

<script>
function ver_barra(image_num)
{    
    //alert(document.getElementById("image_"+image_num).value);
	var barra = document.getElementById("image["+image_num+"]").value;
	window.open('<?php echo $this->_tpl_vars['conf']['html']; ?>
/ver_barra.php?nameBarra='+barra,'ventanita','toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=450,height=400,left=30,top=30');
}
</script>

<?php echo '
<script>
function cambiar(esto)
{
	vista=document.getElementById(esto).style.display;
	if (vista==\'none\')
		vista=\'block\';
	else
		vista=\'none\';

	document.getElementById(esto).style.display = vista;
}

</script>
'; ?>


		
       <form method="POST" action="<?php echo $this->_tpl_vars['conf']['html']; ?>
/edit_answer.php" name="qform" enctype="multipart/form-data">
        <input type="hidden" name="aid" value="<?php echo $this->_tpl_vars['answer']['aid']; ?>
">
	    <input type="hidden" name="qid" value="<?php echo $this->_tpl_vars['data']['qid']; ?>
">
        <input type="hidden" name="sid" value="<?php echo $this->_tpl_vars['answer']['sid']; ?>
">
<table width="952" border="0" cellpadding="0" cellspacing="0">

  <!--DWLayoutTable-->
  <tr>
    <td  width="15" height="214" valign="top"    ><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td   width="935" valign="top"><table     width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="935" height="53" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
			 <td colspan="2" align="center" valign="top"  >
			 
			 <?php if (isset($this->_sections["success"])) unset($this->_sections["success"]);
$this->_sections["success"]['name'] = "success";
$this->_sections["success"]['loop'] = is_array("1") ? count("1") : max(0, (int)"1");
$this->_sections["success"]['show'] = (bool)$this->_tpl_vars['show']['success'];
$this->_sections["success"]['max'] = $this->_sections["success"]['loop'];
$this->_sections["success"]['step'] = 1;
$this->_sections["success"]['start'] = $this->_sections["success"]['step'] > 0 ? 0 : $this->_sections["success"]['loop']-1;
if ($this->_sections["success"]['show']) {
    $this->_sections["success"]['total'] = $this->_sections["success"]['loop'];
    if ($this->_sections["success"]['total'] == 0)
        $this->_sections["success"]['show'] = false;
} else
    $this->_sections["success"]['total'] = 0;
if ($this->_sections["success"]['show']):

            for ($this->_sections["success"]['index'] = $this->_sections["success"]['start'], $this->_sections["success"]['iteration'] = 1;
                 $this->_sections["success"]['iteration'] <= $this->_sections["success"]['total'];
                 $this->_sections["success"]['index'] += $this->_sections["success"]['step'], $this->_sections["success"]['iteration']++):
$this->_sections["success"]['rownum'] = $this->_sections["success"]['iteration'];
$this->_sections["success"]['index_prev'] = $this->_sections["success"]['index'] - $this->_sections["success"]['step'];
$this->_sections["success"]['index_next'] = $this->_sections["success"]['index'] + $this->_sections["success"]['step'];
$this->_sections["success"]['first']      = ($this->_sections["success"]['iteration'] == 1);
$this->_sections["success"]['last']       = ($this->_sections["success"]['iteration'] == $this->_sections["success"]['total']);
?>  
            <div class="message">
              Respuesta editada satisfactoriamente.
            </div>
          <?php endfor; endif; ?>
        

        <?php if (isset($this->_sections["error"])) unset($this->_sections["error"]);
$this->_sections["error"]['name'] = "error";
$this->_sections["error"]['loop'] = is_array("1") ? count("1") : max(0, (int)"1");
$this->_sections["error"]['show'] = (bool)$this->_tpl_vars['show']['error'];
$this->_sections["error"]['max'] = $this->_sections["error"]['loop'];
$this->_sections["error"]['step'] = 1;
$this->_sections["error"]['start'] = $this->_sections["error"]['step'] > 0 ? 0 : $this->_sections["error"]['loop']-1;
if ($this->_sections["error"]['show']) {
    $this->_sections["error"]['total'] = $this->_sections["error"]['loop'];
    if ($this->_sections["error"]['total'] == 0)
        $this->_sections["error"]['show'] = false;
} else
    $this->_sections["error"]['total'] = 0;
if ($this->_sections["error"]['show']):

            for ($this->_sections["error"]['index'] = $this->_sections["error"]['start'], $this->_sections["error"]['iteration'] = 1;
                 $this->_sections["error"]['iteration'] <= $this->_sections["error"]['total'];
                 $this->_sections["error"]['index'] += $this->_sections["error"]['step'], $this->_sections["error"]['iteration']++):
$this->_sections["error"]['rownum'] = $this->_sections["error"]['iteration'];
$this->_sections["error"]['index_prev'] = $this->_sections["error"]['index'] - $this->_sections["error"]['step'];
$this->_sections["error"]['index_next'] = $this->_sections["error"]['index'] + $this->_sections["error"]['step'];
$this->_sections["error"]['first']      = ($this->_sections["error"]['iteration'] == 1);
$this->_sections["error"]['last']       = ($this->_sections["error"]['iteration'] == $this->_sections["error"]['total']);
?>
          <div class="error"><?php echo $this->_tpl_vars['show']['error']; ?>
</div>
        <?php endfor; endif; ?>
			 </td>
			 </tr>
          <tr>
            <td width="464" height="33" valign="top"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
             
              <tr>
                <td width="464" height="33" valign="top"><strong><a href="javascript:cambiar('tres')">+</a> Tipo
                  de Respuesta</strong>             
				   	<select name="type" size="1">
                     <option value="MS" <?php echo $this->_tpl_vars['answer']['selected']['MS']; ?>
>MS - Multiples Opciones, Una Respuesta</option>
					 <option value="MM" <?php echo $this->_tpl_vars['answer']['selected']['MM']; ?>
>MM - Multiples Opciones, Multiples Respuestas</option>
					 <!--  <option value="T" <?php echo $this->_tpl_vars['answer']['selected']['T']; ?>
>T - Textbox, large</option>
					 <option value="S" <?php echo $this->_tpl_vars['answer']['selected']['S']; ?>
>S - Textbox, small</option>-->
					 <!-- <option value="NUM" <?php echo $this->_tpl_vars['answer']['selected']['NUM']; ?>
>NUM - Numeric Answer</option>
					 <option value="DATE" <?php echo $this->_tpl_vars['answer']['selected']['DATE']; ?>
>DATE - Date/Time Answer</option> -->
					 <!--   <option value="N" <?php echo $this->_tpl_vars['answer']['selected']['N']; ?>
>N - No Answer Values</option>-->
					</select>
					
					</td>
                      </tr>
              <tr>
                <td valign="top">
                  <div id="tres" style="display: none;">
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <!--DWLayoutTable-->
                      <tr>
                        <td width="464" height="120" valign="top">
                          * MS = Multiples opciones, una sola respuesta a escoger.<br />
                          * MM = Multiples opciones, mas de una respuesta a escoger<br /><br />
                          Answer Values (MS and MM Answer Types only) 
                          You must supply a list of possible answers if you selected MS or MM for an Answer Type. 
                          List one answer per text box in the boxes below. Use the button at the bottom of the boxes to add more boxes for more answers. The order you list the answers here is the order they will be presented in the surveys. 
                          You can optionally assign a numeric value to each answer value that you provide, also. This numeric value can then be used when exporting the results to a CSV file for processing by other analysis programs.	 </td>
                              </tr>
                      </table>
                        </div>			
					</td>
                      </tr>
              </table></td>
                  <td width="471">&nbsp;</td>
                </tr>
          <tr>
            <td height="20"></td>
                  <td></td>
                </tr>
          
          </table></td>
          </tr>
      <tr>
        <td height="106" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td height="56" colspan="2" valign="top">
			
			
			
			
			  <table width="100%" border="0" cellpadding="0" cellspacing="0">
			    <!--DWLayoutTable-->
			    <tr>
			      <td width="36" height="24" valign="bottom" align="center"><strong>Num</strong></td>
                        <td width="261" align="center" valign="bottom"><strong>Valor de Respuesta (Visualizar)</strong></td>
                        <td width="55" align="center" valign="bottom" ><strong>Valor Numerico</strong></td>
                        <td width="129" align="center" valign="bottom" ><strong>Imagen de Grafico de Barra </strong></td>
                        <td width="60" align="center" valign="bottom" ><strong>Ver <br />  Barra </strong></td>
                        <td width="51" align="left" valign="bottom" ><strong>Puntaje</strong></td>
                        <td width="223" align="center" valign="bottom"><strong>Imagen
                            de Respuesta. max 20KB-Size 120x50 Solo tipo .gif .jpg
                        .jpeg .png</strong></td>
                        <td colspan="2" align="right" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
                      </tr>
			    <?php if (isset($this->_sections["i"])) unset($this->_sections["i"]);
$this->_sections["i"]['name'] = "i";
$this->_sections["i"]['loop'] = is_array($this->_tpl_vars['answer']['num_answers']) ? count($this->_tpl_vars['answer']['num_answers']) : max(0, (int)$this->_tpl_vars['answer']['num_answers']);
$this->_sections["i"]['show'] = (bool)"TRUE";
$this->_sections["i"]['max'] = $this->_sections["i"]['loop'];
$this->_sections["i"]['step'] = 1;
$this->_sections["i"]['start'] = $this->_sections["i"]['step'] > 0 ? 0 : $this->_sections["i"]['loop']-1;
if ($this->_sections["i"]['show']) {
    $this->_sections["i"]['total'] = $this->_sections["i"]['loop'];
    if ($this->_sections["i"]['total'] == 0)
        $this->_sections["i"]['show'] = false;
} else
    $this->_sections["i"]['total'] = 0;
if ($this->_sections["i"]['show']):

            for ($this->_sections["i"]['index'] = $this->_sections["i"]['start'], $this->_sections["i"]['iteration'] = 1;
                 $this->_sections["i"]['iteration'] <= $this->_sections["i"]['total'];
                 $this->_sections["i"]['index'] += $this->_sections["i"]['step'], $this->_sections["i"]['iteration']++):
$this->_sections["i"]['rownum'] = $this->_sections["i"]['iteration'];
$this->_sections["i"]['index_prev'] = $this->_sections["i"]['index'] - $this->_sections["i"]['step'];
$this->_sections["i"]['index_next'] = $this->_sections["i"]['index'] + $this->_sections["i"]['step'];
$this->_sections["i"]['first']      = ($this->_sections["i"]['iteration'] == 1);
$this->_sections["i"]['last']       = ($this->_sections["i"]['iteration'] == $this->_sections["i"]['total']);
?>
			    <input type="hidden" name="img_path_answer_actual[<?php echo $this->_tpl_vars['answer']['avid'][$this->_sections['i']['index']]; ?>
]" value="<?php echo $this->_tpl_vars['answer']['img_path'][$this->_sections['i']['index']]; ?>
">	
			    <tr>
			      <td height="32" align="center" valign="middle"><?php echo $this->_sections['i']['iteration']; ?>
.</td>
                        <td align="center" valign="middle"><input type="text" name="value[<?php echo $this->_tpl_vars['answer']['avid'][$this->_sections['i']['index']]; ?>
]" value="<?php echo $this->_tpl_vars['answer']['value'][$this->_sections['i']['index']]; ?>
" size="35" maxlength="255" /></td>
                        <td align="center" valign="middle"><input type="text" name="numeric_value[<?php echo $this->_tpl_vars['answer']['avid'][$this->_sections['i']['index']]; ?>
]" value="<?php echo $this->_tpl_vars['answer']['numeric_value'][$this->_sections['i']['index']]; ?>
" size="5" /></td>
                        <td align="center" valign="middle">
						<select name="image[<?php echo $this->_tpl_vars['answer']['avid'][$this->_sections['i']['index']]; ?>
]" size="1">
                          <?php if (isset($this->_sections["img"])) unset($this->_sections["img"]);
$this->_sections["img"]['name'] = "img";
$this->_sections["img"]['loop'] = is_array($this->_tpl_vars['answer']['allowable_images']) ? count($this->_tpl_vars['answer']['allowable_images']) : max(0, (int)$this->_tpl_vars['answer']['allowable_images']);
$this->_sections["img"]['show'] = (bool)"TRUE";
$this->_sections["img"]['max'] = $this->_sections["img"]['loop'];
$this->_sections["img"]['step'] = 1;
$this->_sections["img"]['start'] = $this->_sections["img"]['step'] > 0 ? 0 : $this->_sections["img"]['loop']-1;
if ($this->_sections["img"]['show']) {
    $this->_sections["img"]['total'] = $this->_sections["img"]['loop'];
    if ($this->_sections["img"]['total'] == 0)
        $this->_sections["img"]['show'] = false;
} else
    $this->_sections["img"]['total'] = 0;
if ($this->_sections["img"]['show']):

            for ($this->_sections["img"]['index'] = $this->_sections["img"]['start'], $this->_sections["img"]['iteration'] = 1;
                 $this->_sections["img"]['iteration'] <= $this->_sections["img"]['total'];
                 $this->_sections["img"]['index'] += $this->_sections["img"]['step'], $this->_sections["img"]['iteration']++):
$this->_sections["img"]['rownum'] = $this->_sections["img"]['iteration'];
$this->_sections["img"]['index_prev'] = $this->_sections["img"]['index'] - $this->_sections["img"]['step'];
$this->_sections["img"]['index_next'] = $this->_sections["img"]['index'] + $this->_sections["img"]['step'];
$this->_sections["img"]['first']      = ($this->_sections["img"]['iteration'] == 1);
$this->_sections["img"]['last']       = ($this->_sections["img"]['iteration'] == $this->_sections["img"]['total']);
?>
                            <option value="<?php echo $this->_tpl_vars['answer']['allowable_images'][$this->_sections['img']['index']]; ?>
"<?php echo $this->_tpl_vars['answer']['image_selected'][$this->_sections['i']['index']][$this->_sections['img']['index']]; ?>
><?php echo $this->_tpl_vars['answer']['allowable_images'][$this->_sections['img']['index']]; ?>
</option>
                          <?php endfor; endif; ?>
                        </select>
                        </td>
                        <td align="center" valign="middle"><input type="button" name="verBarra" value="Ver" onclick="ver_barra(<?php echo $this->_tpl_vars['answer']['avid'][$this->_sections['i']['index']]; ?>
);" /></td>
                        <td align="left" valign="middle"><input type="text" name="puntaje[<?php echo $this->_tpl_vars['answer']['avid'][$this->_sections['i']['index']]; ?>
]"  value="<?php echo $this->_tpl_vars['answer']['puntaje'][$this->_sections['i']['index']]; ?>
" size="3" <?php if ($this->_tpl_vars['data']['tipo'] == 0): ?>readonly<?php endif; ?>></td>
                        <td align="center" valign="middle"><input name="Imagen_Answer[]" type="file" size="16" /></td>
                        <td width="39" align="right" valign="top"><?php if ($this->_tpl_vars['answer']['img_path'][$this->_sections['i']['index']] != ""): ?><img src="html_image_a/<?php echo $this->_tpl_vars['answer']['img_path'][$this->_sections['i']['index']]; ?>
" /><?php endif; ?></td>
                        <td width="68" align="left" valign="top"><?php if ($this->_tpl_vars['answer']['img_path'][$this->_sections['i']['index']] != ""): ?><input type="checkbox" name="delete_image[<?php echo $this->_tpl_vars['answer']['avid'][$this->_sections['i']['index']]; ?>
]" value="1">Quitar Imagen<?php endif; ?></td>
                      </tr>
			    <tr>
			      <td height="0"></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
			    </tr>
			    
			    <?php endfor; endif; ?>
			    </table></td>
                <td width="15">&nbsp;</td>
          </tr>
          <tr>
            <td width="392" height="30" valign="top">
			 <?php if (isset($this->_sections["add_answer"])) unset($this->_sections["add_answer"]);
$this->_sections["add_answer"]['name'] = "add_answer";
$this->_sections["add_answer"]['loop'] = is_array("1") ? count("1") : max(0, (int)"1");
$this->_sections["add_answer"]['show'] = (bool)$this->_tpl_vars['answer']['show_add_answers'];
$this->_sections["add_answer"]['max'] = $this->_sections["add_answer"]['loop'];
$this->_sections["add_answer"]['step'] = 1;
$this->_sections["add_answer"]['start'] = $this->_sections["add_answer"]['step'] > 0 ? 0 : $this->_sections["add_answer"]['loop']-1;
if ($this->_sections["add_answer"]['show']) {
    $this->_sections["add_answer"]['total'] = $this->_sections["add_answer"]['loop'];
    if ($this->_sections["add_answer"]['total'] == 0)
        $this->_sections["add_answer"]['show'] = false;
} else
    $this->_sections["add_answer"]['total'] = 0;
if ($this->_sections["add_answer"]['show']):

            for ($this->_sections["add_answer"]['index'] = $this->_sections["add_answer"]['start'], $this->_sections["add_answer"]['iteration'] = 1;
                 $this->_sections["add_answer"]['iteration'] <= $this->_sections["add_answer"]['total'];
                 $this->_sections["add_answer"]['index'] += $this->_sections["add_answer"]['step'], $this->_sections["add_answer"]['iteration']++):
$this->_sections["add_answer"]['rownum'] = $this->_sections["add_answer"]['iteration'];
$this->_sections["add_answer"]['index_prev'] = $this->_sections["add_answer"]['index'] - $this->_sections["add_answer"]['step'];
$this->_sections["add_answer"]['index_next'] = $this->_sections["add_answer"]['index'] + $this->_sections["add_answer"]['step'];
$this->_sections["add_answer"]['first']      = ($this->_sections["add_answer"]['iteration'] == 1);
$this->_sections["add_answer"]['last']       = ($this->_sections["add_answer"]['iteration'] == $this->_sections["add_answer"]['total']);
?>
			  Agregar
              <select name="add_answer_num" size="1">
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="5">5</option>
                <option value="10">10</option>
                <option value="20">20</option>
                </select>
              campo mas para llenar Valores.
            
			  <input type="submit" name="add_answers_submit" value="agregar">
			  <input type="hidden" name="num_answers" value="<?php echo $this->_tpl_vars['answer']['num_answers']; ?>
"><?php endfor; endif; ?> </td>
                  <td width="530">&nbsp;</td>
                  <td>&nbsp;</td>
          </tr>
          <tr>
            <td height="19">&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
				
          </table></td>
          </tr>
      <tr>
        <td height="26" valign="top" align="center">
		
		<input type="submit" name="submit" value="Editar Respuesta">
		</td>
          </tr>
      <tr>
        <td height="29">&nbsp;</td>
          </tr>
  
    </table></td>
    </tr>

</table>
   </form>